﻿//配置文件
$.ajaxSetup({
    cache: false //close AJAX cache
});
iconfig = {
    ///#region handles
    handles: {
        post: 'Handlers/Post.ashx'
        , upload: 'Handlers/Upload.ashx'
    }
    ///#endregion
    ///#region system setting
    , system: {
        isloadUI: true //配置loadui的方式，是否区域加载,false时，为页面url传递ui
        , defcontainer: '#content' //web main content container id
        , paramctr: '#footer'
    }
    ///#endregion
    ///#region common
    , common: {
        valuesplit: ','
    }
    ///#endregion

    ///#region foramt
    , format: {
        date: 'yyyy-MM-dd'
        , datetime: 'yyyy-MM-dd hh:mm:ss'
        , dateHM: 'yyyy-MM-dd hh:mm'
        
        , decimalfraction: 2
    }
    ///#endregion

    ///#region controls
    , controls: {//constrols公共设置
        cssonlyctr: 'onlyctr'  //唯一控件样式，一个控件，多个caller,根据设置的不同，显示位置不同，如:datepicker
    }
    , button: {
        def: '<a id="btn_{0}" class="btn" {2}><span>{1}</span></a>'
    , inputbtn: '<input id="btn_{0}" type="button" class="btn" value="{1}" {2} />'
    , imgbtn: '<a id="ibtn_{0}" class="icon {2}" title="{1}" {3}/> '
    , linkbtn: '<a id="lbtn_{0}" class="lbtn" {2}>{1}</a>'
    }
    , chooser: {
        css: {
            zindex: 1000
                , width: 0
                , height: ''
                , left: -10            //对应x轴的偏移量
                , top: -10           //对象y轴的偏移量
                , fixwidth: 0     //控件宽度修正
        }
    }
    , modal: {
        zindex: 2800
        , width: 550
        , height: 300
        , css: 'modalpanel'
        ,contentid:'mw_content'
    }
    , dialog: {
        zindex: 2800
        , width: 400
        , height: 300
    }
    , pager: {
        pagesizes: [5, 10, 12, 15, 20]
    }
    , grid: {
        pagesize: 10
        , width: ''
        , height: ''
    }
    , validator: {
        errorcss: {
            zindex: 1500
             , opacity: 0.8
            , width: 200
            , height: 'auto'
            , left: 5            //对应x轴的偏移量
            , top: 0           //对象y轴的偏移量
        }
       , rules: {
           int: '^[0-9\ ]+$'
            , num: '^[0-9]+(.[0-9]{0,[p]})?$'
            , float: '^[0-9]+(.[0-9]{0,[p]})?$'
            , date: '^[0-9]{4}\-\[0-9]{1,2}\-\[0-9]{1,2}$'
            , datetime: '^[0-9]{4}\-\[0-9]{1,2}\-\[0-9]{1,2} (\[0-9]{1,2}):(\[0-9]{1,2}):(\[0-9]{1,2})$'
            , email: '[a-zA-Z0-9_\.\-]+\@([a-zA-Z0-9\-]+\.)+[a-zA-Z0-9]{2,4}$'
            , url: '^((https|http|ftp|rtsp|mms)://)?[a-z0-9A-Z]{3}\.[a-z0-9A-Z][a-z0-9A-Z]{0,61}?[a-z0-9A-Z]\.com|net|cn|cc (:s[0-9]{1-4})?/$'
            , onlyletter: '^[a-zA-Z\ \']+$'
            , noSign: '^[0-9a-zA-Z]+$'
            , img: 'jpg|gif|png|bmp'
            , doc: 'xls|txt|doc'
       }
    }
    , message: {
        width: 200
        , height: null
        , zindex: 3500
        , showtime: null
        , css: 'message'
        , timeout: 3000
    }
    , menu: {
        css: {
            zindex: 2000
        }
        , menu: {
            container: '<ul>'
            , item: '<li><a ui="${ui}" onclick="linktoPage(this)" >${name}</a></li>'
        }
        , accordion: {
            container: '<dl>'
            , item: '<dt><a ui="${ui}" onclick="linktoPage(this)" >${name}</a></dt>'
        }
    }
    , tabs: {
        container: '<ul>'
         , item: '<li><a href="#${target}" ui="${ui}">${name}</a></li>'
    }
    , sitemap: {
          container: '<ul>'
         , item: '<li><a onclick="linktoPage(this)" ui="${ui}">${name}</a></li>'
    }
    , tree: {
        teml: {
            container: '<ul>'
        , item: '<li><a>${name}</a></li>'
        , itemmulit: '<li><samp v="${value}"/><a>${name}</a></li>'
        },
        filtercss: {
            zindex: 1000
                , width: 0
                , height: ''
                , left: 2             //对应x轴的偏移量
                , top: 0             //对象y轴的偏移量
                , fixwidth: -6
        }
    }
    , struct: {
        teml: {
            container: '<ul>'
            , item: '<li><a ui="${ui}" onclick="linktoPage(this)" target="_blank">${name}</a></li>'
        }
    }
    , datepicker: {
        css: {
            zindex: 3000
            , width: 177
            , height: ''
            , left: -2            //对应x轴的偏移量
            , top: -5          //对象y轴的偏移量
            //            , fixwidth: 0
        }
        ,yearRange: [-5, 5]
    }
    , tooltip: {
        css: {
            zindex: 1500
            , opacity: 0.9
                , width: 300
                , height: 'auto'
                , left: 2           //对应x轴的偏移量
                 , top: -10           //对象y轴的偏移量
        }
    }
    , rangeselector:
    {
        split: '<span class="rangeto"></span>'
    }
    ///#endregion

///#region html模板
, html: {
    common: {
        clear: '<div class="clear" />'
    }
    , ctrItem: {
        item: '<li class="sitem" />'
    , title: '<span class="stitle" />'
    , desc: '<span class="sdesc" />'
    }
}
///#endregion

}